package com.gack.helper.interceptor;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
public class MyWebAppConfigurer extends WebMvcConfigurerAdapter{
	
	@Bean
	public PermissionInterceptor getPermissionInterceptor(){
		return new PermissionInterceptor(); 
	}
	
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		
		registry.addInterceptor(getPermissionInterceptor())
				.addPathPatterns("/test");
				
		super.addInterceptors(registry);
	}
	
}
